package j2025.j02;

/**
 * @Author 猫大仙
 */
public class j0222 {
    public void moveZeroes(int[] nums) {
        int n = nums.length;
        int zero = -1,num = 0;
        while (num<n){
            if(nums[num]==0){
                num++;
            }else {
                zero++;
                //交换
                int tmp = nums[num];
                nums[num] = nums[zero];
                nums[zero] = tmp;
                num++;
            }
        }
    }
}
